import { request } from "@/utils/request";
import type { Category } from "@/types/layout/layout";
import type { ResType, Picture, News, Hots } from "@/types/home/home";
// 获取轮播图
export function getBannerAPI(params: { distributionSite: string }) {
  const { distributionSite = "1" } = params;
  return request<ResType<Picture[]>>({
    url: "/home/banner",
    method: "get",
    params: {
      distributionSite,
    },
  });
}
//获取新鲜好物数据
export function getRecommendAPI() {
  return request<ResType<News[]>>({
    url: "/home/new",
    method: "get",
  });
}
//获取人气推荐数据
export function getHotAPI() {
  return request<ResType<Hots[]>>({
    url: "/home/hot",
    method: "get",
  });
}
//获取所有商品模块
export function getGoodsAPI() {
  return request<ResType<Category[]>>({
    url: "/home/goods",
    method: "get",
  });
}
